package com.tanchengjin.admin.modules.blog.validations;

import com.tanchengjin.admin.modules.blog.validations.annotation.Captcha;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

@Data
public class UsernamePasswordValidate {
    @NotEmpty(message = "用户名不能为空")
    @Length(min = 3, max = 50, message = "用户名长度必须在3~50之间")
    private String username;
    @NotEmpty(message = "密码不能为空")
    @Length(min = 3, max = 100, message = "密码必须在3~100位之间")
    private String password;
    @NotEmpty(message = "验证码不能为空")
    @Length(min = 4, max = 4, message = "请输入4位的验证码")
    @Captcha()
    private String code;
}
